using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using CWB.Web.Configuration;
using CWB.Web.Misc;

namespace CWB.Web.Mvc.Extensions
{
    public static class UrlExtension
    {
        public static string CdnContent(this UrlHelper url, string contentPath)
        {
            return string.Concat(CdnManager.CDNServer + "CDN" + contentPath, "?v=", AppConfigManager.SystemSetting.StaticFileVersionNumber);
        }

        public static string CultureRoute(this UrlHelper url, string culture, string controllerName, string actionName)
        {
            return url.Action(actionName, controllerName, new { culture = culture });//(culture, new { controller = controllerName, action = actionName });
        }

        public static string CultureRoute(this UrlHelper url, string culture, string controllerName, string actionName, string id)
        {
            return url.Action(actionName, controllerName, new { culture = culture, id = id });//(culture, new { controller = controllerName, action = actionName });
        }
    }
}
